package com.zj.z11select.controller.client;


import com.zj.z11select.service.IndexImgService;
import com.zj.z11select.vo.BaseResult;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 轮播图  前端控制器
 * </p>
 *
 * @author ZHOUJIE
 * @since 2021-08-09
 */
@RestController
@RequestMapping("/client/indexImg")
@CrossOrigin
@Slf4j
@RequiredArgsConstructor
public class IndexImgController {

    private final IndexImgService indexImgService;

    @ApiOperation("首页轮播图")
    @GetMapping("/list")
    public BaseResult listIndexImg(){
        try {
            return BaseResult.success(this.indexImgService.selectIndexImgList());
        } catch (Exception e) {
           log.error(">listIndexImg>error：",e);
           return BaseResult.error(e.getMessage());
        }
    }
}

